﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HotelManagement.Class;
using System.Collections;

namespace HotelManagement
{
    public partial class DeletedBooking : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ArrayList bookingIdList = BookingAndRoomAvailabilityDBManager.GetAllBookingID();
                ddlBookingId.DataSource = bookingIdList;
                ddlBookingId.DataBind();
                ddlBookingId.SelectedValue = "View All";

            }


        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int bookingId = Convert.ToInt32(ddlBookingId.Text);
            string querystring = "deletedBookingId=" + bookingId.ToString();

            if (BookingAndRoomAvailabilityDBManager.DeleteBooking(bookingId)==1)
            {

                Server.Transfer("DeletedSuccess.aspx?" + querystring);

            }
                       
        }
    }
}